//
//  WmcDevNetworkApiCell.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/6/24.
//

import UIKit

class WmcDevNetworkApiCell: WmcBaseTableCell {
    // Internal
    
    var switchClosure: ((Bool) -> Void)?

    override func makeUI() {
        super.makeUI()

        lineView.backgroundColor = .wmc_grayH19_F5F5F5
        titleLabel.font = UIFont.systemFont(ofSize: 14, weight: .medium)

        contentView.addSubview(titleLabel)
        contentView.addSubview(descLabel1)
        contentView.addSubview(descLabel2)
        contentView.addSubview(lineView)

        titleLabel.snp.makeConstraints { make in
            make.top.equalTo(10)
            make.left.equalTo(25)
            make.right.equalTo(-25)
            make.height.equalTo(20)
        }
        
        descLabel1.snp.makeConstraints { make in
            make.top.equalTo(titleLabel.snp.bottom).offset(5)
            make.left.equalTo(25)
            make.right.equalTo(-25)
            make.height.equalTo(20)
        }
        
        descLabel2.snp.makeConstraints { make in
            make.top.equalTo(descLabel1.snp.bottom).offset(5)
            make.left.equalTo(25)
            make.right.equalTo(-25)
            make.bottom.equalTo(-10)
        }
        
        lineView.snp.makeConstraints { make in
            make.left.equalTo(12)
            make.right.equalTo(-12)
            make.bottom.equalToSuperview()
            make.height.equalTo(1)
        }
    }

    func bindModel(_ model: WmcDevNetworkApiListVM.WmcApiModel) {
        titleLabel.text = model.name
        descLabel1.text = model.path
        descLabel2.text = model.link
    }
    
    private lazy var descLabel1: UILabel = {
        let label = UILabel()
        label.font = 13.wmc_font
        label.textColor = .wmc_grayH5_606066
        label.textAlignment = .left
        return label
    }()

    private lazy var descLabel2: UILabel = {
        let label = UILabel()
        label.font = 13.wmc_font
        label.textColor = .wmc_grayH5_606066
        label.textAlignment = .left
        label.numberOfLines = 0
        return label
    }()

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    
}

